package o;

import com.huawei.appmarket.pkisign.zip.ZipFormatException;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;

public class dmd {
    private final String ʻ;
    private final long ʼ;
    private final long ʽ;
    private final short ˊ;
    private final int ˊॱ;
    private final int ˋ;
    private final short ˎ;
    private final ByteBuffer ˏ;
    private final int ॱ;
    private final long ॱॱ;
    private final long ᐝ;

    private dmd(ByteBuffer byteBuffer, short s, short s2, int i, int i2, long j, long j2, long j3, long j4, String str, int i3) {
        this.ˏ = byteBuffer;
        this.ˎ = s;
        this.ˊ = s2;
        this.ˋ = i2;
        this.ॱ = i;
        this.ʽ = j;
        this.ᐝ = j2;
        this.ʼ = j3;
        this.ॱॱ = j4;
        this.ʻ = str;
        this.ˊॱ = i3;
    }

    public static dmd ˋ(ByteBuffer byteBuffer) throws ZipFormatException {
        dmh.ˊ(byteBuffer);
        if (byteBuffer.remaining() < 46) {
            throw new ZipFormatException("Input too short. Need at least: 46 bytes, available: " + byteBuffer.remaining() + " bytes");
        }
        int position = byteBuffer.position();
        int i = byteBuffer.getInt();
        if (i != 33639248) {
            throw new ZipFormatException("Not a Central Directory record. Signature: 0x" + Long.toHexString(((long) i) & 4294967295L));
        }
        byteBuffer.position(position + 8);
        short s = byteBuffer.getShort();
        short s2 = byteBuffer.getShort();
        int ˋ = dmh.ˋ(byteBuffer);
        int ˋ2 = dmh.ˋ(byteBuffer);
        long ॱॱ = dmh.ॱॱ(byteBuffer);
        long ॱॱ2 = dmh.ॱॱ(byteBuffer);
        long ॱॱ3 = dmh.ॱॱ(byteBuffer);
        int ˋ3 = dmh.ˋ(byteBuffer);
        i = dmh.ˋ(byteBuffer);
        int ˋ4 = dmh.ˋ(byteBuffer);
        byteBuffer.position(position + 42);
        long ॱॱ4 = dmh.ॱॱ(byteBuffer);
        byteBuffer.position(position);
        ByteBuffer byteBuffer2 = (i + (ˋ3 + 46)) + ˋ4;
        if (byteBuffer2 > byteBuffer.remaining()) {
            throw new ZipFormatException("Input too short. Need: " + byteBuffer2 + " bytes, available: " + byteBuffer.remaining() + " bytes");
        }
        String ˏ = ˏ(byteBuffer, position + 46, ˋ3);
        byteBuffer.position(position);
        int limit = byteBuffer.limit();
        position += byteBuffer2;
        try {
            byteBuffer.limit(position);
            byteBuffer2 = byteBuffer.slice();
            byteBuffer.position(position);
            return new dmd(byteBuffer2, s, s2, ˋ, ˋ2, ॱॱ, ॱॱ2, ॱॱ3, ॱॱ4, ˏ, ˋ3);
        } finally {
            byteBuffer.limit(limit);
        }
    }

    static String ˏ(ByteBuffer byteBuffer, int i, int i2) {
        byte[] array;
        int arrayOffset;
        if (byteBuffer.hasArray()) {
            array = byteBuffer.array();
            arrayOffset = byteBuffer.arrayOffset() + i;
        } else {
            byte[] bArr = new byte[i2];
            int position = byteBuffer.position();
            try {
                byteBuffer.position(i);
                byteBuffer.get(bArr);
                array = bArr;
                arrayOffset = 0;
            } finally {
                byteBuffer.position(position);
            }
        }
        try {
            return new String(array, arrayOffset, i2, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            Logger.e("CentralDirectoryRecord", e.getMessage());
            return "";
        }
    }

    public String ॱ() {
        return this.ʻ;
    }

    public int ˊ() {
        return this.ˊॱ;
    }

    public short ˎ() {
        return this.ˎ;
    }

    public short ˏ() {
        return this.ˊ;
    }

    public long ˋ() {
        return this.ʽ;
    }

    public long ॱॱ() {
        return this.ᐝ;
    }

    public long ᐝ() {
        return this.ʼ;
    }

    public long ʼ() {
        return this.ॱॱ;
    }
}
